<ion-view view-title="企业资料" class="personaldata">
	<ion-nav-bar ng-class="baseclass">
		<ion-nav-back-button>
		</ion-nav-back-button>
		<ion-nav-buttons side="right">
			<button class="button button-clear icon ion-save" on-tap="do_save()" ng-if='isLoad'>{{data.store.store_id?'保存':'申请'}}</button>
		</ion-nav-buttons>
	</ion-nav-bar>

	<ion-content ng-show='isLoad'>
		<div class="head list-inset">
			<div class="row padding-0">
				<div class="col col-100 padding-0">
					{{data.approved_text}}
				</div>
			</div>
		</div>
		
		<div class="list list-inset" ng-if='isLoad'>
				<div class="item item-input item-select" ng-if='!(data.store.store_id)' data-tap-disabled="true" style="padding:0 30px 0 15px;">
						<div class="input-label">企业类型<i class='required'>*</i></div>
						<div class="input-value" ng-click="doSelectGrade()">{{store_grade_select.name}}</div>
					</div>
			<label class="item item-text-wrap" ng-if='!!(data.store.store_id)'>
				企业类型：　
				<span ng-if="data.approved != '1' || !data.is_warehouse">
					{{data.issue_type_text}}
				</span>
				<span ng-if="data.approved == '1' && data.is_warehouse">
					分仓
					<button class="button button-small button-positive" style='position:absolute; right: 10px; top: 12px;'
						on-tap="do_warehouse_upgrade()">转授权中心</button>
				</span>
			</label>
		</div>
		

		<!--<div class="list list-inset" ng-if='data.store.issue_type=="3" && data.approved != "1"'>
			<div class="item item-divider">我是分仓<i class='required'>*</i></div>
			<ion-checkbox ng-model="data.is_warehouse" on-tap='change_is_warehouse(true)'>是</ion-checkbox>
			<ion-checkbox ng-model="data.is_not_warehouse" on-tap='change_is_warehouse(false)'>否</ion-checkbox>
		</div>-->

		<div class="list list-inset" ng-if='data.store.issue_type=="3" && data.is_warehouse && data.approved != "1"'>
			<div class="item item-divider">相关旗舰店<i class='required'>*</i></div>
			<div class="item item-button-right" style='height: 54px;'>
				{{data.store.relation_manu_store_name}}
				<button class="button button-assertive" on-tap="select_relation_manu()">
					{{data.store.relation_manu_store_id ? '更改' : '选择'}}
				</button>
			</div>
		</div>

		<div class="list list-inset">
			<div class="item item-divider">公司</div>
			<label class="item item-input" ng-if="data.approved != '1'"><span class="input-label">店铺名称<i class='required'>*</i></span>
				<input type="text" placeholder="请输入店铺名称" ng-model='data.store.store_name' maxlength='30' ng-disabled="data.approved == '1'"></label>
			<div class="item item-text-wrap" ng-if="data.approved == '1'">
				店铺名称：　{{data.store.store_name}}
			</div>

			<label class="item item-input" ng-if="data.approved != '1'"><span class="input-label">公司名称<i class='required'>*</i></span>
				<input type="text" placeholder="请输入公司名称" ng-model='data.store.company_name' maxlength='30' ng-disabled="data.approved == '1'"></label>
			<div class="item item-text-wrap" ng-if="data.approved == '1'">
				公司名称：　{{data.store.company_name}}
			</div>

			<div ng-hide="data.store.issue_type=='3' && data.is_warehouse">
				<label class="item item-input" ng-if="data.approved != '1'">
					<label>统一社会信用代码<i class='required'>*</i></label>
					<input type="text" class="padding-left-5-my" style="padding-right: 10px;" placeholder="统一社会信用代码" ng-model='data.store.company_no' maxlength='30'>
				</label>
				<div class="item item-text-wrap" ng-if="data.approved == '1'">
					统一社会信用代码：{{data.store.company_no}}
				</div>

				<div ng-if='data.store.issue_type=="4"'>
					<div ng-if="data.approved != '1'">
						<label class="item item-input">
							<span class="input-label">法人姓名<i class='required'>*</i></span><input type="text" placeholder="请输入法人姓名" ng-model='data.store.company_idname' maxlength='30'></label>
						<label class="item item-input">
							<span class="input-label">法人身份证号<i class='required'>*</i></span><input type="text" placeholder="请输入法人身份证号" ng-model='data.store.company_idcard' maxlength='18'></label>
					</div>
					<div ng-if="data.approved == '1'">
						<div class="item item-text-wrap">
							法人姓名：　{{data.store.company_idname}}
						</div>
						<div class="item item-text-wrap">
							法人身份证号：{{data.store.company_idcard}}
						</div>
					</div>
				</div>

				<div ng-if='data.store.issue_type=="1" || data.store.issue_type=="2"'>
					<div ng-if="data.approved != '1'">
						<div ng-if='data.store.issue_type=="1" || data.store.issue_type=="2"'>
							<div class="item item-divider">销售类型<i class='required'>*</i></div>
							<ion-checkbox ng-model="data.is_domestic" ng-readonly=""="data.approved == '1'">内销</ion-checkbox>
							<ion-checkbox ng-model="data.is_export" ng-readonly="data.approved == '1'">外销</ion-checkbox>
						</div>
					</div>
					<div class="item item-text-wrap" ng-if="data.approved == '1'">
						销售类型：　<span ng-if='data.is_domestic'>内销</span>
						<span ng-if='data.is_domestic && data.is_export'>&nbsp;&nbsp;</span>
						<span ng-if='data.is_export'>外销</span>
					</div>
				</div>
				<div class="item item-input item-select" ng-if='data.store.issue_type=="1" || data.store.issue_type=="4"' data-tap-disabled="true" style="padding:0 30px 0 15px;">
						<div class="input-label">经营性质<i class='required'>*</i></div>
						<div class="input-value" ng-click="doSelectBusiness(data.approved)">{{business_select.text}}</div>
				</div>
			</div>
		</div>

		<div class="list list-inset" ng-hide="data.store.issue_type=='3' && data.is_warehouse">
			<div class="item item-divider item-input">
				<span class="input-label">经营范围<i class='required'>*</i></span>
			</div>
			<label class="item item-input" ng-if="data.approved != '1'">
				<textarea rows="5" placeholder="经营范围" style="padding-right: 44px;" ng-model='data.store.company_remark' maxlength='200' ng-disabled="data.approved == '1'"></textarea>
			</label>
			<div class="item item-text-wrap" ng-if="data.approved == '1'">
				{{data.store.company_remark}}
			</div>
		</div>

		<div class="list list-inset">
			<div class="item item-divider item-input">
				<span class="input-label">公司地址<i class='required'>*</i></span>
				<button class="button button-small button-dark icon ion-ios-location" style='position:absolute; right: 10px;'
						on-tap="do_location()" ng-if="data.approved != '1'">&nbsp;定位</button>
			</div>
			<li class="item padding-5" ng-if="data.approved != '1'">
				<div class="row text-center">
						<div class="input-value small" ng-click="doSelectProvince()">{{data.store_region.data.value1_select.text}}</div>
						<div class="input-value small" ng-click="doSelectCity()">{{data.store_region.data.value2_select.text}}</div>
						<div class="input-value small" ng-click="doSelectDistrict()">{{data.store_region.data.value3_select.text}}</div>
				</div>
			</li>

			<div  ng-if="data.approved == '1'">
				<div class="item item-text-wrap">
					{{data.store_company_area}}
					<br />
					{{data.store.company_addr}}
				</div>
			</div>
			<label class="item item-input" ng-if="data.approved != '1'">
				<span class="input-label">
					详细地址<i class='required'>*</i>
				</span>
				<textarea rows="3" placeholder="请输入详细地址" style="padding-right: 44px;" ng-model='data.store.company_addr' maxlength='200'></textarea>
			</label>
			<label class="item padding-0" ng-style="{height: map_height+'px'}" >
				<div id='company_addr_map'  ng-style="{height: map_height+'px', width: '100%'}"></div>
			</label>
		</div>

		<div class="list list-inset" ng-hide="data.store.issue_type=='3' && data.is_warehouse">
			<div class="item item-divider padding item-icon-right">
				主营品类<i class='required'>*</i><span class="font-small-my assertive" ng-if="data.approved == '1'">（如果要修改主营分类，请联系平台客服）</span>
				<i class="icon ion-plus-circled positive" on-tap="add_StoreCat()" ng-if="data.approved != '1'"></i>
			</div>
			<!--选择品类-->
			<div class="item item-input item-select"  ng-if="data.approved != '1'" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">大分类</div>
					<div class="input-value" ng-click="doSelectCat1()">{{input.cat1.name}}</div>
				</div>
				<div class="item item-input item-select"  ng-if="data.approved != '1'" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">中分类</div>
					<div class="input-value" ng-click="doSelectCat2()">{{input.cat2.name}}</div>
				</div>
				<div class="item item-input item-select"  ng-if="data.approved != '1'" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">小分类</div>
					<div class="input-value" ng-click="doSelectCat3()">{{input.cat3.name}}</div>
				</div>
			<!--显示品类-->
			<li class="item item-icon-right padding-5" ng-repeat="cat in data.catShow track by $index">
				{{cat}}
				<i class="icon ion-close-circled assertive font-1rem-my" on-tap="remove_StoreCat($index)" ng-if="data.approved != '1'"></i>
			</li>
		</div>

		<div class="list list-inset" ng-if="false">
			<div ng-hide="data.store.issue_type=='1' || data.store.issue_type=='2'" >
				<div class="item item-divider item-input">
					<span class="input-label">主营品牌<i class='required'>*</i></span>
					<button class="button button-small button-dark" style='right: 10px; position: absolute;'>+</button>
				</div>
				<a class="item item-icon-left item-icon-right">
					<i class="icon"></i>
					Check mail
					<i class="icon ion-chevron-right" style='font-size: 14px;'></i>
				</a>
			</div>
		</div>

		<div class="list list-inset" ng-hide="data.store.issue_type=='3' && data.is_warehouse">
			<div class="item item-divider">企业简介<i class='required'>*</i></div>
			<label class="item item-input">
				<textarea rows="5" placeholder="企业简介" style="padding-right: 44px;" ng-model='data.store.company_profile' maxlength='200'></textarea>
			</label>
		</div>

		<div class="list list-inset">

			<div class="item item-divider">负责人</div>
			<label class="item item-input"><span class="input-label">姓名</span>
				<input type="text" placeholder="请输入负责人姓名" ng-model='data.store.company_cname' maxlength='20'></label>
				<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
						<div class="input-label">性别</div>
						<div class="input-value" ng-click="doSelectSex(1)">{{company_cgender_select.name}}</div>
					</div>
		</div>

		<div class="list list-inset">
			<div class="item item-divider">联系人</div>
			<label class="item item-input"><span class="input-label">姓名<i class='required'>*</i></span>
				<input type="text" placeholder="请输入联系人姓名" ng-model='data.store.contact_name' maxlength='20'></label>
			<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
					<div class="input-label">性别</div>
					<div class="input-value" ng-click="doSelectSex(2)">{{contact_gender_select.name}}</div>
				</div>
			<label class="item item-input"><span class="input-label">部门</span>
				<input type="text" placeholder="请输入联系人部门" ng-model='data.store.contact_depart' maxlength='30'></label>
			<label class="item item-input"><span class="input-label">职业</span>
				<input type="text" placeholder="请输入联系人职业" ng-model='data.store.contact_charge' maxlength='30'></label>
			<label class="item item-input"><span class="input-label">手机<i class='required'>*</i></span>
				<input type="text" placeholder="请输入联系人手机" ng-model='data.store.contact_mobile' maxlength='20'></label>
			<label class="item item-input"><span class="input-label">固话</span>
				<input type="text" placeholder="请输入联系人固话" ng-model='data.store.contact_number' maxlength='20'></label>
			<label class="item item-input"><span class="input-label">QQ</span>
				<input type="text" placeholder="请输入联系人邮箱" ng-model='data.store.contact_qq' maxlength='20'></label>
			<label class="item item-input"><span class="input-label">EMAIL</span>
				<input type="text" placeholder="请输入联系人邮箱" ng-model='data.store.contact_email' maxlength='20'></label>
		</div>


		<div class="list list-inset" ng-if="!(data.store.issue_type=='3' && data.is_warehouse)">
			<div class="item item-divider">上传文件</div>

			<label class="item item-input"><span class="input-label">营业执照<i class='required'>*</i></span>
				<a class="add input-file" href="javascript:void(0);" ng-if='!!data.store.image_cid'>
					<img ng-src='{{data.store.image_cid_path}}' on-tap="openFileActSheet('image_cid')"/>
				</a>
				<a class="add input-file" href="javascript:void(0);" ng-if='!data.store.image_cid' on-tap="addStoreImg('image_cid')"><span class="icon ion-plus"></span></a>
			</label>
			<label class="item item-input" ng-if='data.store.issue_type=="1"'><span class="input-label">生产许可证</span>
				<a class="add input-file" href="javascript:void(0);" ng-repeat="img in data.store.image_licence">
					<img ng-src='{{data.store.image_licence_path[$index]}}' on-tap="openFileActSheet('image_licence', $index)"/></a>
				<a class="add input-file" href="javascript:void(0);"><span class="icon ion-plus" on-tap="addStoreImg('image_licence')"></span></a>
			</label>
			<label class="item item-input" ng-if='data.store.issue_type!="4"'><span class="input-label">{{data.store.issue_type=='3'?'荣誉证书':'品牌证书'}}<i class='required' ng-show="data.store.issue_type=='2'">*</i></span>
				<a class="add input-file" href="javascript:void(0);" ng-repeat="img in data.store.image_cert1">
					<img ng-src='{{data.store.image_cert1_path[$index]}}' on-tap="openFileActSheet('image_cert1', $index)"/></a>
				<a class="add input-file" href="javascript:void(0);"><span class="icon ion-plus" on-tap="addStoreImg('image_cert1')"></span></a>
			</label>
			<label class="item item-input" ng-if='data.store.issue_type!="4"'><span class="input-label">{{data.store.issue_type=='3'?'授权书':'各类型证书'}}</span>
				<a class="add input-file" href="javascript:void(0);" ng-repeat="img in data.store.image_cert2">
					<img ng-src='{{data.store.image_cert2_path[$index]}}' on-tap="openFileActSheet('image_cert2', $index)"/></a>
				<a class="add input-file" href="javascript:void(0);"><span class="icon ion-plus" on-tap="addStoreImg('image_cert2')"></span></a>
			</label>

			<div class="item item-divider">{{data.picname}}照片</div>
			<label class="item item-input"><span class="input-label">&nbsp;&nbsp;&nbsp;照片1<i class='required'>*</i></span>
				<a class="add input-file" href="javascript:void(0);" ng-if='!!data.store.image_place1'>
					<img ng-src='{{data.store.image_place1_path}}' on-tap="openFileActSheet('image_place1')"/></a>
				<a class="add input-file" href="javascript:void(0);" ng-if='!data.store.image_place1' on-tap="addStoreImg('image_place1')"><span class="icon ion-plus"></span></a>
			</label>
			<label class="item item-input"><span class="input-label">&nbsp;&nbsp;&nbsp;照片2<i class='required'>*</i></span>
				<a class="add input-file" href="javascript:void(0);" ng-if='!!data.store.image_place2'>
					<img ng-src='{{data.store.image_place2_path}}' on-tap="openFileActSheet('image_place2')"/></a>
				<a class="add input-file" href="javascript:void(0);" ng-if='!data.store.image_place2' on-tap="addStoreImg('image_place2')"><span class="icon ion-plus"></span></a>
			</label>
			<label class="item item-input" ng-if='data.store.issue_type!="4"'><span class="input-label">&nbsp;&nbsp;&nbsp;照片3<i class='required'>*</i></span>
				<a class="add input-file" href="javascript:void(0);" ng-if='!!data.store.image_place3'>
					<img ng-src='{{data.store.image_place3_path}}' on-tap="openFileActSheet('image_place3')"/></a>
				<a class="add input-file" href="javascript:void(0);" ng-if='!data.store.image_place3' on-tap="addStoreImg('image_place3')"><span class="icon ion-plus"></span></a>
			</label>
			<label class="item item-input" ng-if='data.store.issue_type!="4"'><span class="input-label">&nbsp;&nbsp;&nbsp;照片4<i class='required'>*</i></span>
				<a class="add input-file" href="javascript:void(0);" ng-if='!!data.store.image_place4'>
					<img ng-src='{{data.store.image_place4_path}}' on-tap="openFileActSheet('image_place4')"/></a>
				<a class="add input-file" href="javascript:void(0);" ng-if='!data.store.image_place4' on-tap="addStoreImg('image_place4')"><span class="icon ion-plus"></span></a>
			</label>

			<div class="item item-divider">法人身份证</div>
			<label class="item item-input"><span class="input-label">&nbsp;&nbsp;&nbsp;正面</span>
				<a class="add input-file" href="javascript:void(0);" ng-if='!!data.store.image_id'>
					<img ng-src='{{data.store.image_id_path}}' on-tap="openFileActSheet('image_id')"/></a>
				<a class="add input-file" href="javascript:void(0);" ng-if='!data.store.image_id' on-tap="addStoreImg('image_id')"><span class="icon ion-plus"></span></a>
			</label>
			<label class="item item-input"><span class="input-label">&nbsp;&nbsp;&nbsp;反面</span>
				<a class="add input-file" href="javascript:void(0);" ng-if='!!data.store.image_id2'>
					<img ng-src='{{data.store.image_id2_path}}' on-tap="openFileActSheet('image_id2')"/></a>
				<a class="add input-file" href="javascript:void(0);" ng-if='!data.store.image_id2' on-tap="addStoreImg('image_id2')"><span class="icon ion-plus"></span></a>
			</label>
		</div>
	</ion-content>
</ion-view>